<template>
    <div class="l-from-body" >
        <el-form :model="formData" :rules="rules" size="mini"  ref="form" label-width="80px" >
            <el-col :span="24">
                <el-form-item label="名称" prop="f_Name">
                    <el-input v-model="formData.f_Name"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="24">
                <el-form-item label="值" prop="f_Value">
                    <el-input v-model="formData.f_Value"></el-input>
                </el-form-item>
            </el-col>
        </el-form>
    </div>
</template>
<script>
export default {
    data(){
        return {
            formData:{
                f_Name:'',
                f_Value:'',
            },
            rules: {
                f_Name: [
                    { required: true, message: '请输入名称' }
                ],
                f_Value: [
                    { required: true, message: '请输入值' }
                ]
            }
        };
    },
    methods:{
        resetForm(){
            this.formData.f_Id = '';
            this.$refs.form && this.$refs.form.resetFields();
        },
        // 校验表单
        validateForm(callback){
            this.$refs.form.validate((valid) => {
                if(valid){
                    callback();
                }
            });
        },
        setForm(data){
            this.formData = this.$deepClone(data);
        },
        getForm(){
            let formData = this.$deepClone(this.formData);
            return formData;
        }
    }
}
</script>